Package com.fsf.news.service
Class NewsActiveSearchServiceTest
java.lang.Object
com.fsf.news.service.NewsActiveSearchServiceTest
@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
class NewsActiveSearchServiceTest
extends Object
Unit tests for the NewsActiveSearchService class.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) com.fsf.news.model.form.NewsForm(package private) com.fsf.news.repository.NewsActiveSearchRepository(package private) com.fsf.news.service.NewsActiveSearchService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidTests that the registerSearch method throws an exception when no session ID is provided.(package private) voidTests that the clearSession method removes all searches for a given session.(package private) voidTests that the clearSession method throws an exception when no session ID is provided.(package private) voidTests that the getActiveSearch method returns the expected result.(package private) voidTests that the getActiveSearches method returns the expected results.(package private) voidTests that the getActiveSearches method throws an exception when no session ID is provided.(package private) voidTests that the getActiveSearch method throws an exception when no session ID is provided.(package private) voidTests that the registerSearch method registers a search and returns the expected result.(package private) voidTests that the removeActiveSearch method deletes a search identified by its form.(package private) voidTests that the removeActiveSearch method throws an exception when no session ID is provided.(package private) voidTests that the updateLatestResult method updates an existing active search.(package private) voidTests that the updateLatestResult method creates a new active search when no existing search is found.(package private) voidTests that the updateLatestResult method throws an exception when no session ID is provided.
-
Field Details
-
service
@InjectMocks com.fsf.news.service.NewsActiveSearchService service -
repository
@Mock com.fsf.news.repository.NewsActiveSearchRepository repository -
form
@Mock com.fsf.news.model.form.NewsForm form
-
-
Constructor Details
-
NewsActiveSearchServiceTest
NewsActiveSearchServiceTest()
-
-
Method Details
-
testGetActiveSearches
@Test void testGetActiveSearches()Tests that the getActiveSearches method returns the expected results. -
testGetActiveSearchesException
@Test void testGetActiveSearchesException()Tests that the getActiveSearches method throws an exception when no session ID is provided. -
testGetActiveSearch
@Test void testGetActiveSearch()Tests that the getActiveSearch method returns the expected result. -
testGetActiveSearchException
@Test void testGetActiveSearchException()Tests that the getActiveSearch method throws an exception when no session ID is provided. -
testRegisterSearch
@Test void testRegisterSearch()Tests that the registerSearch method registers a search and returns the expected result. -
testAddSearchResultException
@Test void testAddSearchResultException()Tests that the registerSearch method throws an exception when no session ID is provided. -
testUpdateLatestResult
@Test void testUpdateLatestResult()Tests that the updateLatestResult method updates an existing active search. -
testUpdateLatestResultEmpty
@Test void testUpdateLatestResultEmpty()Tests that the updateLatestResult method creates a new active search when no existing search is found. -
testUpdateLatestResultException
@Test void testUpdateLatestResultException()Tests that the updateLatestResult method throws an exception when no session ID is provided. -
testRemoveActiveSearch
@Test void testRemoveActiveSearch()Tests that the removeActiveSearch method deletes a search identified by its form. -
testRemoveActiveSearchException
@Test void testRemoveActiveSearchException()Tests that the removeActiveSearch method throws an exception when no session ID is provided. -
testClearSession
@Test void testClearSession()Tests that the clearSession method removes all searches for a given session. -
testClearSessionException
@Test void testClearSessionException()Tests that the clearSession method throws an exception when no session ID is provided.
-